package com.shiguiwu.springmybatis.app.controller;

import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @description: 测试
 * @author: stone
 * @date: Created by 2021/11/10 11:33
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.app.controller
 */
@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {

    /**
     * 测试中文乱码
     * @return
     */
    @GetMapping(value = "/code",produces = "text/html;charset=UTF-8")
    public String code() {
        return "我是谁";
    }

    /**
     * 测试中文乱码,报错的
     *
     * @return
     */

    @Value("${aa:0}")
    private boolean f;
    @GetMapping(value = "/code/map",produces = "text/html;charset=UTF-8")
    public  HashMap<String, String>  map() {

        log.info("aaaa ===> {}", f);

        HashMap<String, String> of = MapUtil.of("shiguiwu", "我是谁");
        return of;
    }






    public static void main(String[] args) {

        String a = "shi_guiwu";

        System.out.println(StrUtil.toCamelCase(a));
    }
}
